package cn.shujuhai.workflow.controller.flow;

import cn.shujuhai.common.pluging.data.ResultVo;
import cn.shujuhai.workflow.domain.FormData;
import cn.shujuhai.workflow.domain.FormProcess;
import cn.shujuhai.workflow.service.FormProcessService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: ZhangDeZhong
 * @Date: 2025/3/25 14:55
 * @Description:
 **/
@RestController
@RequestMapping("/workflow/processFrom")
@RequiredArgsConstructor
public class ProcessFromController {

    private final FormProcessService formProcessService;

    @PostMapping("/setProcessForm")
    public ResultVo<?> setProcessForm(@RequestBody FormProcess formProcess) {
        return this.formProcessService.setProcessForm(formProcess);
    }

    @GetMapping("/getFromField")
    public ResultVo<?> getFromField(@RequestParam String processDefinitionId) {
        return this.formProcessService.getFromField(processDefinitionId);
    }

    @PostMapping("/addFormData")
    public ResultVo<?> addFormData(@RequestBody FormData formData) {
        return this.formProcessService.addFormData(formData);
    }


}
